Chapter 1
Chapter 2:
Concatenation operator
Variables
Constants
Data types
Data conversion
Scanner class

String class is not included for the quiz

- Be an active member of the community

- openClaw? open source project
Moltbook?

- 1st year anniversary: vibe coding

- StringMethods.java

full.substring(idx1, idx2); // Gets the character stored at indexes idx1 (inclusive) through 
idx2 (exclusive)

- In Java, String objects are immutable
StringBuilder is a mutable equivalent of String

// =  assignment
// == equality operator: 3 == 3
// str1 == str2 we are comparing addresses
// instead: str1.equals(str2)


- compareTo: int
< 0: if I come before 
0: if we are equal
> 0: I come after

String str1 = "able";
String str2 = "bake";

str1.compareTo(str2); // < 0

str2 = "Bake";
str1.compareTo(str2); // > 0

// Arrow functions <=> lambdas will help us create our own ordering rules

- replace

String first = "Wissam";
String firstModified = first.replace('s', 'S');
System.out.println(firstModified); // WiSSam

Example#1: StringMethods.java

- Random: java.util

nextFloat()
nextInt()
nextInt(int upper) ---> {0, ..., upper - 1}

Example#2: RandomDemo.java

[lower; upper]

rnd.nextInt(a) + b ---> {0, ..., a - 1} + b ---> {b, ..., b + a - 1}
b = lower
b + a - 1 = upper ==> a = upper - b + 1

App: 1) UI; 2) Business logic; 3) Data
NextJS


nextFloat() ----> random floating point value between 0.0 (inclusive) and 1.0 (exclusive)
Use nextFloat to generate a random int value between 1 and 6:

Random rnd = new Random();

(int) rnd.nextFloat() * 6 + 1


nextInt() ---> generate a random int between the min int value (Integer.MIN_VALUE) and 
max int value (Integer.MAX_VALUE)

Let us use nextInt() to generate a random int between 1 and 6

Hint: 

Math.abs(a) % b ---> [0; b-1]


Math.abs(rnd.nextInt()) % 6 + 1 ---> {1, 2, 3, 4, 5, 6}

































 







